package com.IntelligentCommunity.community.controller;

import com.IntelligentCommunity.common.core.domain.R;
import com.IntelligentCommunity.community.domain.Tree;
import com.IntelligentCommunity.community.service.IRealAreaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 美国五星上将麦克阿瑟
 */
@RestController
@RequestMapping("/area")
public class RealAreaController {

    @Autowired
    private IRealAreaService areaService;

    @GetMapping("/treeselect/{flag}")
    public R treeselect(@PathVariable("flag") int flag){
        List<Tree> areaList = areaService.selectAreaTree(flag);
        return R.ok(areaList);
    }

}
